<?php

class Framework_Presenter_Smarty_IncludePhp extends Framework_Presenter_Smarty_Extension {

	public function __construct() {
		parent::__construct();
	}
	
	public static function register( &$smartyObj ) {
		$smartyExtension = new Framework_Presenter_Smarty_IncludePhp();
		$smartyObj->register_function( 'includePhp', array($smartyExtension, 'include_php') );
	}
	
	public function include_php( $params ) { 
	
		extract( $params );
	
		if ( empty( $file ) ) {
			$smarty->trigger_error( "includePhp: missing 'file' parameter" ) ;
			return;
		}
	
		include( $file ); 
	}
	
	public function __destruct() {
	
	}
	
}
?>